<template>
  <div>
  <div>
    <el-table
      :model="queryHigher"
      :data="tableData"
      style="width: 100%;line-height: 25%;"
      align="right"
      @row-click="addDialog"
    >
      <el-table-column prop="proposerId" label="申请人id" width="180" v-if="false">
      </el-table-column>
      <el-table-column prop="demurLoginId" label="业务id" width="20" v-if="false">
      </el-table-column>
      <el-table-column prop="demurTypeName" label="业务类型" width="180">
      </el-table-column>
      <el-table-column prop="precontractStatus" label="业务状态" width="180">
      </el-table-column>
      <el-table-column prop="proposerName" label="申请人"> </el-table-column>
      <el-table-column prop="proposerCard" label="身份证件号码"> </el-table-column>
      <el-table-column prop="createTime" label="受理时间"> </el-table-column>
      <el-table-column prop="assignee" label="受理人"> </el-table-column>
    </el-table>
</div>
<div>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="this.queryHigher.pageNow"
        :page-sizes="[5, 10, 20, 100]"
        :page-size="this.queryHigher.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="this.total"

      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: [],
  methods: {
    tableRowClassName() {
      this.$axios.post("/register-serv/files/selectAlls",this.queryHigher)
      .then((res)=>{
          this.tableData = res.data.data.list;
          this.total=res.data.data.total;
      });
    },

    //每页显示的条数变化时
    handleSizeChange(val) {
      this.queryHigher.pageSize = val;
      this.tableRowClassName();
    },
    // 当前页数变化时
    handleCurrentChange(val) {
      this.queryHigher.pageNow = val;
      this.tableRowClassName();
    },
    

    //跳转到资料录入页面
    addDialog(row){
      console.log(this.roomNo)
      if(row.demurTypeName=='所有权初始登记'){
        this.$router.push({path: '/Zlsh',query:{ proposerId:(row.proposerId),proposerCard:(row.proposerCard),proposerName:(row.proposerName),demurTypeName:(row.demurTypeName),precontractStatus:(row.precontractStatus),demurLoginId:(row.demurLoginId),roomNo:(this.roomNo)}});
      }else if(row.demurTypeName=='商品预售许可证登记'){
        this.$router.push({path: '/Pressp',query:{ proposerId:(row.proposerId),proposerCard:(row.proposerCard),proposerName:(row.proposerName),demurLoginId:(row.demurLoginId)}});
      }else{
        this.$router.push({path:'/Syqlr',query:{  proposerId:(row.proposerId),proposerCard:(row.proposerCard),proposerName:(row.proposerName),demurLoginId:(row.demurLoginId)}});
      }
    },
  },
  data() {
    return {
      queryHigher:{
          proposerName:'',
          proposerCard:'',
          businessNum:'',
          demurTypeName:"",
          demurLoginId:'',
          pageSize: 5,
          pageNow: 1,
          precontractStatus:'<已入库>'
      },
      tableData: [
      ],
      page:{
        total:0
      },
      total:'',
      roomNo:''
    };
  },
  mounted(){
    this.tableRowClassName();
    this.roomNo=this.$router.query.roomNo;
    
  },
};
</script>
<style scoped>

.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}

</style>